import requests
from config import url, headers_web


class LearningActivities:

    def __init__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def post_learningmaterials(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:学习活动-学习材料统计列表
        @Description:1.云课堂 管理端 学习活动-学习材料列表使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/learningactivitiesstatistic/learningmaterials"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_labreport(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:学习活动-实验报告统计列表
        @Description:1.云课堂 管理端 学习活动-实验报告列表使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/learningactivitiesstatistic/labreport"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_homework(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:学习活动-课后作业统计列表
        @Description:1.云课堂 管理端 学习活动-课后作业列表使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/learningactivitiesstatistic/homework"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_learningtest(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:学习活动-学情测验统计列表
        @Description:1.云课堂 管理端 学习活动-学情测验列表使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/learningactivitiesstatistic/learningtest"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r

    @classmethod
    def post_learningmaterials_excel(cls, url: str, params=None, headers=headers_web, json=None):
        """
        @Summary:学习活动-学习材料统计列表导出Excel
        @Description:1.云课堂 管理端 学习活动-学习材料列表导出Excel使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/learningactivitiesstatistic/learningmaterialsexcel"
        r = requests.post(url=url, params=params, headers=headers, json=json)
        return r
